import request from '@/utils/request'

// 查询租房-房源信息列表
export function listGoods(query) {
  return request({
    url: '/mall/goods/list',
    method: 'get',
    params: query
  })
}

// 查询租房-房源信息详细
export function getGoods(id) {
  return request({
    url: '/mall/goods/' + id,
    method: 'get'
  })
}

// 新增租房-房源信息
export function addGoods(data) {
  return request({
    url: '/mall/goods',
    method: 'post',
    data: data
  })
}

// 修改租房-房源信息
export function updateGoods(data) {
  return request({
    url: '/mall/goods',
    method: 'put',
    data: data
  })
}

// 删除租房-房源信息
export function delGoods(id) {
  return request({
    url: '/mall/goods/' + id,
    method: 'delete'
  })
}

// 导出租房-房源信息
export function exportGoods(query) {
  return request({
    url: '/mall/goods/export',
    method: 'get',
    params: query
  })
}

// 下载模板
export function importTemplate() {
  return request({
    url: '/mall/goods/importTemplate',
    method: 'get',
  })
}

//租房-下架房源
export function offShelf(query) {
  return request({
    url: '/mall/goods/offShelf',
    method: 'get',
    params: query
  })
}

//租房-上架房源
export function onShelf(query) {
  return request({
    url: '/mall/goods/onShelf',
    method: 'get',
    params: query
  })
}